﻿// 开发者:micropu
// 公司:佛山远钧智慧科技有限公司

using Elastic.Clients.Elasticsearch;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Application.Entity;

/// <summary>
/// 人脸设备
/// </summary>
[SugarTable("zj_Device", TableDescription = "人脸设备")]
public class Device : EntityTenantBaseData
{
    /// <summary>
    /// 名称
    /// </summary>
    [SugarColumn(ColumnDescription = "名称", Length = 200)]
    public string Name { get; set; }

    /// <summary>
    /// 客户端设备号
    /// </summary>
    [SugarColumn(ColumnDescription = "客户端设备号", Length = 200)]
    public string ClientSn { get; set; }

    /// <summary>
    /// 通行方向
    /// </summary>
    [SugarColumn(ColumnDescription = "通行方向")]
    public DirectionType Direction { get; set; }

    /// <summary>
    /// 项目ID
    /// </summary>
    [SugarColumn(ColumnDescription = "项目ID")]
    public long ProjectId { get; set; }

    /// <summary>
    /// 所属项目
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToOne, nameof(ProjectId))] 
    public Project Project { get; set; }

    /// <summary>
    /// 通信方式
    /// </summary>
    [SugarColumn(ColumnDescription = "通信方式")]
    public ConnectType DeviceConnect { get; set; }

    /// <summary>
    /// 设备型号
    /// </summary>
    [SugarColumn(ColumnDescription = "设备型号")]
    public ModelType DeviceModel { get; set; }

    /// <summary>
    /// 是否拉取人员信息
    /// </summary>
    [SugarColumn(ColumnDescription = "是否拉取人员信息", DefaultValue = "false")]
    public bool EnableGetEmpInfo { get; set; }

    /// <summary>
    /// 是否允许下发人员到设备
    /// </summary>
    [SugarColumn(ColumnDescription = "是否允许下发人员到设备",DefaultValue = "true")]
    public bool EnableEmpSend { get; set; } = false;

    /// <summary>
    /// 是否接收通行记录
    /// </summary>
    [SugarColumn(ColumnDescription = "是否接收通行记录",DefaultValue = "true")]
    public bool EnableRecLog { get; set; } = false;

    /// <summary>
    /// 是否上传通行记录
    /// </summary>
    [SugarColumn(ColumnDescription = "是否上传通行记录", DefaultValue = "true")]
    public bool EnableUploadLog { get; set; } = false;

    /// <summary>
    /// 是否保存不匹配通行记录
    /// </summary>
    [SugarColumn(ColumnDescription = "是否保存不匹配通行记录", DefaultValue = "false")]
    public bool EnableRecNotMatchUploadLog { get; set; } = false;

    /// <summary>
    /// 客户端在线
    /// </summary>
    [SugarColumn(ColumnDescription = "客户端在线")]
    public bool IsOnline { get; set; }

    /// <summary>
    /// 服务端在线
    /// </summary>
    [SugarColumn(ColumnDescription = "服务端在线",DefaultValue = "false")]
    public bool IsOnlineServer { get; set; }

    /// <summary>
    /// 状态（ 1启用 2停用）
    /// </summary>
    [SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
    public StatusEnum Status { get; set; }
}
